package com.springboot.redis.util;

import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @Author wangzs
 * @Version 1.0
 * @Description 常青树信息
 * @Date 2021/1/15 12:46
 */
@ControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(value =Exception.class)
    @ResponseBody
    public String exceptionHandler(Exception e){
        System.out.println("未知异常！原因是:"+e);
        return "未知异常！原因是:"+e.getMessage();
    }


}
